using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ProjectCastamere
{
    class Enemy
    {
        /// <summary>
        /// enemies health
        /// </summary>
        private int health;

        // the enemies path across the map to the core
        private Path path;

        /// <summary>
        /// construct an enemy and gives them a starting maximum health
        /// </summary>
        /// <param name="health"></param>
        public Enemy(Path path, int health)
        {
            this.health = health;
            this.path = path;
        }

        /// <summary>
        /// does damage to an enemy based on a damage description, can override this
        /// to make enemies stronger etc. give them extra traits (shields etc.)
        /// </summary>
        /// <param name="damage"></param>
        public virtual void TakeHit(DamageDesc damage)
        {
            health -= damage.damage;
            if (health <= 0)
            {
                health = 0;
            }
        }

        /// <summary>
        /// determines whether the enemy is dead or not
        /// </summary>
        /// <returns></returns>
        public bool IsDead()
        {
            return health == 0;
        }
    }
}
